package com.kkd.kkdapp.activity;

import java.text.DecimalFormat;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.kkd.kkdapp.R;
import com.kkd.kkdapp.base.BaseActivity;
import com.kkd.kkdapp.listener.OnSingleClickListener;

public class WithdrawSuccessTipActivity extends BaseActivity {

	private Context mContext = this;
	private double amount;
	private TextView tv_title_step1;
	private DecimalFormat df = new DecimalFormat("#,###.00");

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_withdraw_success_tip);
		amount = getIntent().getDoubleExtra("amount", 0);
		initView();
	}

	private void initView() {
		findViewById(R.id.tv_summary).setOnClickListener(mClickListener);
		findViewById(R.id.tv_toMyEveryday).setOnClickListener(mClickListener);
		tv_title_step1 = (TextView) findViewById(R.id.tv_title_step1);
		String amountString = df.format(amount).startsWith(".") ? ("0" + df
				.format(amount)) : df.format(amount);
		tv_title_step1.setText("转出金额: " + amountString + "（元）");
	}

	private OnSingleClickListener mClickListener = new OnSingleClickListener() {

		@Override
		public void onSingleClick(View v) {
			switch (v.getId()) {
			case R.id.tv_summary:
				AccountEverydayActivity.mActivity.finish();
				finish();
				break;

			case R.id.tv_toMyEveryday:
				finish();
				break;

			default:
				break;
			}
		}
	};
}
